<?php
	session_start();
	if(!isset($_SESSION['login'])){
		header('location:../vue/index.php');
	}
	include '../model/model_sql.php';
	
	$user = 'root';
	$password = 'root';
	$datasource = 'mysql:host=localhost;dbname=blog;charset=utf8';
	$myvartest = new PDO ($datasource,$user,$password);
	$row = $myvartest->query('SELECT id_utilisateur, id_categorie FROM post LEFT OUTTER JOIN categorie_post ON post.id=categorie_post.id WHERE id=\''.$_GET['art_id'].'\'');
	var_dump($row);
	
	$myvar = new SQLBlog();
	if($var=$myvar->SupprimerUnPost($_GET['art_id'], $row['id_categorie'], $row['id_utilisateur'])){
	header('location:../vue/index.php');
	} else var_dump($var);

?>
